<?php

class Statistics

{
 
              /*function to get the total number of users on the site*/

		function getTotalUsers(){

			$query = "SELECT `id` FROM `users`";
			$result = mysql_query($query);
                        $total = mysql_num_rows($result);
			return $total;			

		}
		
		/*end function*/
		
		/*function to get the total number of files uploaded on the site*/

		function getTotalUploads(){

			$query = "SELECT `id` FROM `uploads`";
			$result = mysql_query($query);
                        $total = mysql_num_rows($result);
			return $total;			

		}
		
		/*end function*/
		
		/*function to get the total number of downloads on the site*/

		function getTotalDownloads(){

			$query = "SELECT `file_id` FROM `downloads`";
			$result = mysql_query($query);
                        $total = mysql_num_rows($result);
			return $total;			

		}
		
		/*end function*/

}

global $statistics;

$statistics = new Statistics();

?>